#include "apue.h"

static void my_exit1(void);
static void my_exit2(void);

int main()
{
    if(atexit(my_exit2)!=0)
    {
        err_sys("Can't register my_exit2");
    }
    if(atexit(my_exit1)!=0)
    {
        err_sys("Can't register my_exit1");
    }
    if(atexit(my_exit1)!=0)
    {
        err_sys("Can't register my_exit1");
    }
    printf("Main Function is Done!\n");
    return 0;
}

static void my_exit1(void)
{
    printf("First exit handler\n");
}

static void my_exit2(void)
{
    printf("Second Exit Handler\n");
}
